package com.xhtt.modules.inspection.dto;

import com.xhtt.modules.inspection.enums.PointDeviceTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 检测点和绑定的标签
 *
 * @Date 2019-01-23 下午 5:40
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PointLabelDTO {

    /**
     * 检测点id
     */
    private Integer id;

    /**
     * 检测点名称
     */
    private String name;

    /**
     * 标签名称
     */
    private String labelName;

    /**
     * 检测点设备名称
     */
    private String deviceName;

    /**
     * 检测点设备类型
     */
    private int deviceType;

    public void setDeviceType(String deviceType) {
        if (deviceType.equals(PointDeviceTypeEnum.COMMON.getMsg())) {
            this.deviceType = PointDeviceTypeEnum.COMMON.getCode();
        } else if (deviceType.equals(PointDeviceTypeEnum.SPARE.getMsg())) {
            this.deviceType = PointDeviceTypeEnum.SPARE.getCode();
        }
    }

    public void setDeviceType(int deviceType) {
        this.deviceType = deviceType;
    }
}
